#include <stdio.h>
#include <stdlib.h>
#define MAX BITREE_SIZE 20
typedef struct BiTNode{
	char data;
	struct BiTNode *lchild,*rchild;
}BiTNode,*BiTree;

void Create_BitTree(BiTree *T)
{
	char ch;
	ch = getchar();
	printf("==>%c",ch);
	if(ch == '@'){
		*T = NULL;
	}else{
		*T = (BiTree)malloc(sizeof(BiTNode));
		(*T)->data = ch;
		Create_BitTree(&(*T)->lchild);
		Create_BitTree(&(*T)->rchild);		
	}
}
void PreOrder(BiTree T)
{
	if(T){
		printf("%3c",T->data);
		PreOrder(T->lchild);
		PreOrder(T->rchild);
	}
}
void InOrder(BiTree T)
{
	if(T){
		InOrder(T->lchild);
		printf("%3c",T->data);
		InOrder(T->rchild);
	}
}

void PostOrder(BiTree T)
{
	if(T){
		PostOrder(T->lchild);
		PostOrder(T->rchild);
		printf("%s3c",T->data);
	}
}

int main(int argc,char argv[])
{
	BiTree T,p;
	printf("\nInput PreOrder str: ");
	Create_BitTree(&T);
	printf("\n");
	printf("\nPreOrder list of T:");
	PreOrder(T);
	printf("\nInOrder  list of T:");
	InOrder(T);
	printf("\nPostOrderlist of T:");
	PostOrder(T);
}
